/**
 * */
Rsd.define('Rsd.Faith.pages.ReportZiJinCuiJiaoDanListPage', {
    extend: 'Rsd.Faith.pages.ListPage',
    requires: ['Rsd.controlEx.ComboBoxEnum','Rsd.Faith.controls.SuoShuQiInput'],
    xtype: 'list-r-cui-jiao',
    border: false,
    tabTitle: '催缴单',
    searchColumns:[{name:'SuoShuQi',"text": "所属期",xtype:'ctrl-suoshuqi'}],
    newButtons:[{text:'生成催缴',handler:'btn_build'}],
    modelType:'ReportZiJinCuiJiaoDanModel',
    readOnly:false,
    formFields: [],
    gridColumns: [
        {
            "text": "序号",
            "xtype": "index",
            "width": 40,
            "index": 0
        },
        {
            "name": "FangWuBianHao",
            "dataIndex": "FangWuBianHao",
            "sortable": false,
            "text": "房屋编号",
            "index": 20,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "SuoShuQi",
            "dataIndex": "SuoShuQi",
            "sortable": false,
            "text": "所属期",
            "index": 21,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "CuiJiaoDanJieShouRen",
            "dataIndex": "CuiJiaoDanJieShouRen",
            "sortable": false,
            "text": "催缴单接收人",
            "index": 22,
            "exist": true,
            "xtype": "string",
            format:'btn_print',
            "width": 150,
            "nobr": false
        },
        {
            "name": "JieShouRenDianHua",
            "dataIndex": "JieShouRenDianHua",
            "sortable": false,
            "text": "接收人电话",
            "index": 24,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "FangWuDiZhi",
            "dataIndex": "FangWuDiZhi",
            "sortable": false,
            "text": "房屋地址",
            "index": 26,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "DangQianZhangHuYuE",
            "dataIndex": "DangQianZhangHuYuE",
            "sortable": false,
            "text": "当前账户余额",
            "index": 28,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "CuiJiaoJinE",
            "dataIndex": "CuiJiaoJinE",
            "sortable": false,
            "text": "催缴金额",
            "index": 30,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "CuiJiaoNeiRong",
            "dataIndex": "CuiJiaoNeiRong",
            "sortable": false,
            "text": "催缴内容",
            "index": 32,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "CuiJiaoFangShi",
            "dataIndex": "CuiJiaoFangShi",
            "sortable": false,
            "text": "催缴方式",
            "index": 34,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "CuiJiaoZhuangTai",
            "dataIndex": "CuiJiaoZhuangTai",
            "sortable": false,
            "text": "催缴状态",
            "index": 36,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "Remark",
            "dataIndex": "Remark",
            "sortable": false,
            "text": "备注",
            "index": 200,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        }
    ],
    formTitle:'增值账面',
    titleField : 'SuoShuQi',
    /*
     * */
    constructor: function (config) {
        config = config || {};
        Rsd.apply(this, config);
    },
    btn_print:function btn_print(row) {
        return [ Rsd.newLine(),Rsd.btn('打印催交单',function () {
            var key = 'BJ_' + row['Id'];
            var _data=  {
            FWDM:'0000000000',
            XZQY:'三茅',
            JKLX:'补交',
            DZ:'扬中市三茅中电路281号',
            LDH:'20',
            SH:'102',
            YZXM:'张三',
            SFZH:'3200000000000000000',
            BJJE:Rsd.formatCurrency(3600,'¥'),
            JEDX:Rsd.formatCurrencyCN(3600),
            JZDW:'镇江市物业管理中心',
            TBRQ:new Date().format('yyyy-MM-dd'),
            DYRQ:new Date().format('yyyy-MM-dd')
        };
            Rsd.writeSession(key,_data);
            window.open('print.html?tpl=BuJiaoTongZhiDan&key='+key);
        }),Rsd.blankspan(1),,Rsd.btn('已交存')];
    },
    /*
    * */
    btn_build:function () {
        Rsd.app.requestService('report.shenchengcuijiao',{suoShuQi:'2020'},function (data) {
            if(data.success)
            {
                Rsd.popup('生成催缴数据成功');
            }else
            {
                Rsd.alert(data.msg)
            }
        });
    }
});